<?php
$entry = [
    0 => 'foo',
    1 => false,
    2 => - 1,
    3 => null,
    4 => '',
];

print_r(array_filter($entry));
/**
 * Array
 * (
 * [0] => foo
 * [2] => -1
 * )
 */

print_r(array_filter([6, 7, 8, 9, 10, 11, 12], function ($var) {
    return $var % 2 == 0 ? true : false;
}));
/**
 * Array
 * (
 * [0] => 6
 * [2] => 8
 * [4] => 10
 * [6] => 12
 * )
 */